package com.vnp.cooking.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class PreferenceHelper {
	private SharedPreferences sharedPreferences;
	public static final String PREFERENCE_FILE = "preference_file.com.vnp.cooking";

	public final String CHON_LOAIMON = "chon_loai_mon";
	
	public final String ANUONG_DEVICE = "anuong_device_id";
	
	
	public final String CURRENT_TIME = "current_time";
	public final String DATA_NAME = "data_name";
	
	public final String ID = "id";
	public final String USERNAME = "user_name";
	public final String PASSWORD = "pass_word";
	public final String USER_NAME = "name";
	public final String USER_URL_AVATAR = "url_avatar";
	public final String USER_CITY = "city";
	public final String USER_NAME_CITY = "name_city";
	public final String USER_DES = "user_description";
	public final String USER_EXP = "user_exp";
	public final String USER_LEVEL_NAME = "user_level_name";
	public final String USER_EMAIL = "user_email";
	public final String USER_BIRTH = "user_birth";
	public final String USER_GENDER = "user_gender";
	public final String USER_ABOUT = "user_about";

	// friend
	public final String FRIEND_URL_AVATAR = "friend_url_avatar";
	public final String FRIEND_CITY_NAME = "friend_city_name";
	public final String FRIEND_CITY_ID = "friend_city_id";
	public final String FRIEND_LEVEL_NAME = "friend_level_name";
	public final String FRIEND_ABOUT = "friend_about";
	public final String FRIEND_NAME = "friend_name";

	public final String RECIPE_ID = "recipe_id";
	public final String COVER_CT = "cover_url_image";

	public final String SETTINGS_COMMENT = "setting_comment";
	public final String SETTINGS_LIKE = "setting_like";

	// filter
	public final String FITER_SORT = "filter_sort";

	public final String FITER_LOAIMONAN = "filter_loaimonan";
	public final String FITER_LOAIBUAAN = "filter_loaibuaan";
	public final String FITER_THOIGIAN = "filter_thoigian";
	public final String FITER_NGUONGOC = "filter_nguongoc";
	public final String FITER_PHUONGPHAP = "filter_phuongphap";
	public final String FITER_DOKHO = "filter_dokho";

	// value name

	public final String FITER_NAME_SORT = "filter_name_sort";

	public final String FITER_NAME_LOAIMONAN = "filter_name_loaimonan";
	public final String FITER_NAME_LOAIBUAAN = "filter_name_loaibuaan";
	public final String FITER_NAME_THOIGIAN = "filter_name_thoigian";
	public final String FITER_NAME_NGUONGOC = "filter_name_nguongoc";
	public final String FITER_NAME_PHUONGPHAP = "filter_name_phuongphap";
	public final String FITER_NAME_DOKHO = "filter_name_dokho";
	public final String FITER_CHECKED = "filter_checked";

	// id
	public final String FITER_ID_LOAIMONAN = "filter_od_loaimonan";
	public final String FITER_ID_LOAIBUAAN = "filter_id_loaibuaan";
	public final String FITER_ID_THOIGIAN = "filter_id_thoigian";
	public final String FITER_ID_NGUONGOC = "filter_id_nguongoc";
	public final String FITER_ID_PHUONGPHAP = "filter_id_phuongphap";
	public final String FITER_ID_DOKHO = "filter_id_dokho";

	// tao ct
	public final String DESC_CT = "desc_ct";
	public final String ID_DACDIEM = "id_dacdiem";

	// save cache
	public final String CACHE_THUOCTINH = "cache_thuoc_tinh";
	public final String CACHE_BST = "cache_bst";

	public PreferenceHelper(Context context) {
		this.sharedPreferences = context.getSharedPreferences("cooking", 0);
	}

	public String getAnuongDeviceId() {
		return this.sharedPreferences.getString(ANUONG_DEVICE, "");
	}
	
	
	//--------------------time hien tai---------------
	public long getCurrentTime(){
		return this.sharedPreferences.getLong(CURRENT_TIME, 0);
	}
	
	public String getDataName(){
		return this.sharedPreferences.getString(DATA_NAME, "");
	}
	
	
	// -------friend--------------------------
	public String getFriendName() {
		return this.sharedPreferences.getString(FRIEND_NAME, "");
	}

	public String getFriendUrlAvatar() {
		return this.sharedPreferences.getString(FRIEND_URL_AVATAR, "");
	}

	public String getFriendLevelname() {
		return this.sharedPreferences.getString(FRIEND_LEVEL_NAME, "");
	}

	public String getFriendCityName() {
		return this.sharedPreferences.getString(FRIEND_CITY_NAME, "");
	}

	public int getFriendCityID() {
		return this.sharedPreferences.getInt(FRIEND_CITY_ID, 0);
	}

	public String getFriendAbout() {
		return this.sharedPreferences.getString(FRIEND_ABOUT, "");
	}

	// ------------------------------------

	public String getCacheThuoctinh() {
		return this.sharedPreferences.getString(CACHE_THUOCTINH, "");
	}

	public String getCacheBosuutap() {
		return this.sharedPreferences.getString(CACHE_BST, "");
	}

	// ------------------------------------

	public int getIdThoigian() {
		return this.sharedPreferences.getInt(FITER_ID_THOIGIAN, -1);
	}

	public int getIdLoaibua() {
		return this.sharedPreferences.getInt(FITER_ID_LOAIBUAAN, -1);
	}

	public int getIdLoaimon() {
		return this.sharedPreferences.getInt(FITER_ID_LOAIMONAN, -1);
	}

	public int getIdNguongoc() {
		return this.sharedPreferences.getInt(FITER_ID_NGUONGOC, -1);
	}

	public int getIdPhuongphap() {
		return this.sharedPreferences.getInt(FITER_ID_PHUONGPHAP, -1);
	}

	public int getIdDokho() {
		return this.sharedPreferences.getInt(FITER_ID_DOKHO, -1);
	}

	// ------------------------------------
	public int getIdDacdiem() {
		return this.sharedPreferences.getInt(ID_DACDIEM, -1);
	}

	public String getDescCT() {
		return this.sharedPreferences.getString(DESC_CT, "");
	}

	// -------------------------------

	public String getFilterChecked() {
		return this.sharedPreferences.getString(FITER_CHECKED, "");
	}

	// ------------------------------
	public String getFilterNameSort() {
		return this.sharedPreferences.getString(FITER_NAME_SORT, "");
	}

	public String getFilterNameLoaimon() {
		return this.sharedPreferences.getString(FITER_NAME_LOAIMONAN, "");
	}

	public String getFilterNameLoaibuaan() {
		return this.sharedPreferences.getString(FITER_NAME_LOAIBUAAN, "");
	}

	public String getFilterNameThoigian() {
		return this.sharedPreferences.getString(FITER_NAME_THOIGIAN, "");
	}

	public String getFilterNameNguongoc() {
		return this.sharedPreferences.getString(FITER_NAME_NGUONGOC, "");
	}

	public String getFilterNamePhuongphap() {
		return this.sharedPreferences.getString(FITER_NAME_PHUONGPHAP, "");
	}

	public String getFilterNameDokho() {
		return this.sharedPreferences.getString(FITER_NAME_DOKHO, "");
	}

	// ---------------------------------------
	public String getFilterSort() {
		return this.sharedPreferences.getString(FITER_SORT, "");
	}

	public String getFilterLoaimon() {
		return this.sharedPreferences.getString(FITER_LOAIMONAN, "");
	}

	public String getFilterLoaibuaan() {
		return this.sharedPreferences.getString(FITER_LOAIBUAAN, "");
	}

	public String getFilterThoigian() {
		return this.sharedPreferences.getString(FITER_THOIGIAN, "");
	}

	public String getFilterNguongoc() {
		return this.sharedPreferences.getString(FITER_NGUONGOC, "");
	}

	public String getFilterPhuongphap() {
		return this.sharedPreferences.getString(FITER_PHUONGPHAP, "");
	}

	public String getFilterDokho() {
		return this.sharedPreferences.getString(FITER_DOKHO, "");
	}

	// ----------------------------------------
	public String getDataFilter() {
		return this.sharedPreferences.getString("DATA_FILTER", "");
	}

	public int getSettingComment() {
		return this.sharedPreferences.getInt(SETTINGS_COMMENT, -1);
	}

	public int getSettingLike() {
		return this.sharedPreferences.getInt(SETTINGS_LIKE, -1);
	}

	public String getCoverUrl() {
		return this.sharedPreferences.getString(COVER_CT, "");
	}

	public String getRecipeId() {
		return this.sharedPreferences.getString(RECIPE_ID, "");
	}

	public String getUserGender() {
		return this.sharedPreferences.getString(USER_GENDER, "");
	}

	public String getUserAbout() {
		return this.sharedPreferences.getString(USER_ABOUT, "");
	}

	public String getUserBirthl() {
		return this.sharedPreferences.getString(USER_BIRTH, "");
	}

	public String getUserEmail() {
		return this.sharedPreferences.getString(USER_EMAIL, "");
	}

	public String getUserLevelName() {
		return this.sharedPreferences.getString(USER_LEVEL_NAME, "");
	}

	public String getUserEXp() {
		return this.sharedPreferences.getString(USER_EXP, "");
	}

	public String getUserDes() {
		return this.sharedPreferences.getString(USER_DES, "");
	}

	public int getUserCity() {
		return this.sharedPreferences.getInt(USER_CITY, 0);
	}

	public String getNameCity() {
		return this.sharedPreferences.getString(USER_NAME_CITY, "");
	}

	public String getUserUrlAvatar() {
		return this.sharedPreferences.getString(USER_URL_AVATAR, "");
	}

	public String getUserInfoName() {
		return this.sharedPreferences.getString(USER_NAME, "");
	}

	public String getID() {
		return this.sharedPreferences.getString(ID, "");
	}

	public String getUsername() {
		return this.sharedPreferences.getString(USERNAME, "");
	}

	public String getPassword() {
		return this.sharedPreferences.getString(PASSWORD, "");
	}

	/** ------------------------------------------------- */
	public void setUserName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USERNAME, value);
		localEditor.commit();
	}

	public void setPassWord(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(PASSWORD, value);
		localEditor.commit();
	}

	public void setID(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(ID, value);
		localEditor.commit();
	}

	public void setUserInfoName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_NAME, value);
		localEditor.commit();
	}

	public void setUserURLAvatar(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_URL_AVATAR, value);
		localEditor.commit();
	}

	public void setUserCity(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(USER_CITY, value);
		localEditor.commit();
	}

	public void setNameCity(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_NAME_CITY, value);
		localEditor.commit();
	}

	public void setUserDes(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_DES, value);
		localEditor.commit();
	}

	public void setUserExp(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_EXP, value);
		localEditor.commit();
	}

	public void setUserLevelName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_LEVEL_NAME, value);
		localEditor.commit();
	}

	public void setUserEmail(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_EMAIL, value);
		localEditor.commit();
	}

	public void setUserBirth(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_BIRTH, value);
		localEditor.commit();
	}

	public void setUserGender(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_GENDER, value);
		localEditor.commit();
	}

	public void setUserAbout(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(USER_ABOUT, value);
		localEditor.commit();
	}

	public void setRecipeId(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(RECIPE_ID, value);
		localEditor.commit();
	}

	public void setCoverUrl(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(COVER_CT, value);
		localEditor.commit();
	}

	public void setSettingsComment(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(SETTINGS_COMMENT, value);
		localEditor.commit();
	}

	public void setSettingsLike(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(SETTINGS_LIKE, value);
		localEditor.commit();
	}

	// ----------------------------------------------
	public void setDataFilter(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString("DATA_FILTER", value);
		localEditor.commit();
	}

	public void setFilterLoaimonan(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_LOAIMONAN, value);
		localEditor.commit();
	}

	public void setFilterLoaibuaan(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_LOAIBUAAN, value);
		localEditor.commit();
	}

	public void setFilterThoigian(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_THOIGIAN, value);
		localEditor.commit();
	}

	public void setFilterNguocgoc(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NGUONGOC, value);
		localEditor.commit();
	}

	public void setFilterPhuongphap(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_PHUONGPHAP, value);
		localEditor.commit();
	}

	public void setFilterDokho(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_DOKHO, value);
		localEditor.commit();
	}

	public void setFilterSort(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_SORT, value);
		localEditor.commit();
	}

	// --------------------------------------
	public void setFilterNameLoaimonan(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_LOAIMONAN, value);
		localEditor.commit();
	}

	public void setFilterNameLoaibuaan(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_LOAIBUAAN, value);
		localEditor.commit();
	}

	public void setFilterNameThoigian(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_THOIGIAN, value);
		localEditor.commit();
	}

	public void setFilterNameNguocgoc(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_NGUONGOC, value);
		localEditor.commit();
	}

	public void setFilterNamePhuongphap(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_PHUONGPHAP, value);
		localEditor.commit();
	}

	public void setFilterNameDokho(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_DOKHO, value);
		localEditor.commit();
	}

	public void setFilterNameSort(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_NAME_SORT, value);
		localEditor.commit();
	}

	// -------------------------------------

	public void setFilterChecked(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FITER_CHECKED, value);
		localEditor.commit();
	}

	// --------------------------------------

	public void setDescCT(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(DESC_CT, value);
		localEditor.commit();
	}

	public void setIdDacdiem(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(ID_DACDIEM, value);
		localEditor.commit();
	}

	// ------------------------------------

	public void setIdThoigian(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_THOIGIAN, value);
		localEditor.commit();
	}

	public void setIdLoaibua(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_LOAIBUAAN, value);
		localEditor.commit();
	}

	public void setIdLoaimonan(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_LOAIMONAN, value);
		localEditor.commit();
	}

	public void setIdNguongoc(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_NGUONGOC, value);
		localEditor.commit();
	}

	public void setIdPhuongphap(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_PHUONGPHAP, value);
		localEditor.commit();
	}

	public void setIdDokho(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FITER_ID_DOKHO, value);
		localEditor.commit();
	}

	// -------------------------------------------

	public void setCacheBosuutap(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(CACHE_BST, value);
		localEditor.commit();
	}

	public void setCacheThuoctinh(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(CACHE_THUOCTINH, value);
		localEditor.commit();
	}

	// ------------------friend set value---------
	public void setFriendURLAvatar(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FRIEND_URL_AVATAR, value);
		localEditor.commit();
	}

	public void setFriendLevelName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FRIEND_LEVEL_NAME, value);
		localEditor.commit();
	}

	public void setFriendCityName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FRIEND_CITY_NAME, value);
		localEditor.commit();
	}

	public void setFriendCityId(int value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putInt(FRIEND_CITY_ID, value);
		localEditor.commit();
	}

	public void setFriendAbout(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FRIEND_ABOUT, value);
		localEditor.commit();
	}

	public void setFriendName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(FRIEND_NAME, value);
		localEditor.commit();
	}
	
	public void setAnuongDeviceId(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(ANUONG_DEVICE, value);
		localEditor.commit();
	}
	
	public void setCurrentTime(long value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putLong(CURRENT_TIME, value);
		localEditor.commit();
	}
	
	public void setDataName(String value) {
		SharedPreferences.Editor localEditor = this.sharedPreferences.edit();
		localEditor.putString(DATA_NAME, value);
		localEditor.commit();
	}
	

}
